/*
 * Copyright 2006-2008 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package net.martinimix.domain.order;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * Provides a cart header bean.
 * 
 * @author Scott Rossillo
 *
 */
public class CartHeader implements Serializable {
	
	private static final long serialVersionUID = 1L;
	
	private int numLines;
	private int numTopLines;
	private int cartQuantity;
	private int extendedCartQuantity;
	
	private BigDecimal totalPriceAmt;
	private BigDecimal finalPrice;
	private BigDecimal discountAmt;
	
	/**
	 * @@BusinessObjectProperty("totalDiscountAmt")
	 */
	private BigDecimal totalDiscount;
	
	private long priceListFolderId;
	
	private String promotionCode;
	/**
	 * @@BusinessObjectProperty("PromotionsApplied", attribute=true)
	 */
	private String appliedPromotions;
	
	/**
	 * @@BusinessObjectProperty("UniquePromoCode", attribute=true)
	 */
	private String uniquePromoCode;
	
	/**
	 * @@BusinessObjectProperty("LoyaltyPointsRedeemed", attribute=true)
	 */
	private int loyaltyPointsRedeemed;
	
	/**
	 * Creates a new cart header.
	 */
	public CartHeader() { }

	/**
	 * Returns the number of items in this cart.
	 * 
	 * @return the number of items in this cart 
	 */
	public int getNumLines() {
		return numLines;
	}

	/**
	 * Sets the number of items in this cart.
	 * 
	 * @param numLines the number of items in this cart
	 */
	public void setNumLines(int numLines) {
		this.numLines = numLines;
	}

	public int getNumTopLines() {
		return numTopLines;
	}

	public void setNumTopLines(int numTopLines) {
		this.numTopLines = numTopLines;
	}

	/**
	 * Returns the total number of items in this cart.
	 * 
	 * @return the total number of items in this cart
	 */
	public int getCartQuantity() {
		return cartQuantity;
	}

	public void setCartQuantity(int cartQuantity) {
		this.cartQuantity = cartQuantity;
	}

	public int getExtendedCartQuantity() {
		return extendedCartQuantity;
	}

	public void setExtendedCartQuantity(int extendedCartQuantity) {
		this.extendedCartQuantity = extendedCartQuantity;
	}

	public BigDecimal getTotalPriceAmt() {
		return totalPriceAmt;
	}

	public void setTotalPriceAmt(BigDecimal totalPriceAmt) {
		this.totalPriceAmt = totalPriceAmt;
	}

	public BigDecimal getFinalPrice() {
		return finalPrice;
	}

	public void setFinalPrice(BigDecimal finalPrice) {
		this.finalPrice = finalPrice;
	}

	public BigDecimal getDiscountAmt() {
		return discountAmt;
	}

	public void setDiscountAmt(BigDecimal discountAmt) {
		this.discountAmt = discountAmt;
	}

	/**
	 * @return Cart total discount: the sum of
	 * line level and cart level discounts
	 */
	public BigDecimal getTotalDiscount() {
		return totalDiscount;
	}

	/**
	 * Sets Cart Total discount
	 * @param totalDiscount
	 */
	public void setTotalDiscount(BigDecimal totalDiscount) {
		this.totalDiscount = totalDiscount;
	}

	public long getPriceListFolderId() {
		return priceListFolderId;
	}

	public void setPriceListFolderId(long priceListFolderId) {
		this.priceListFolderId = priceListFolderId;
	}
	
	public String getPromotionCode() {
		return promotionCode;
	}

	public void setPromotionCode(String promotionCode) {
		this.promotionCode = promotionCode;
	}

	public String getAppliedPromotions() {
		return appliedPromotions;
	}
	
	/**
	 * Sets the string with the names of the promotions applied to this cart;
	 * 
	 * @param appliedPromotions comma-separated list of the promotions applied to this order 
	 */
	public void setAppliedPromotions(String appliedPromotions) {
		this.appliedPromotions = appliedPromotions;
	}

	public String getUniquePromoCode() {
		return uniquePromoCode;
	}

	/**
	 * @param uniquePromoCode String representing unique promotional code applied to this order
	 */
	public void setUniquePromoCode(String uniquePromoCode) {
		this.uniquePromoCode = uniquePromoCode;
	}
	
	public int getLoyaltyPointsRedeemed() {
		return loyaltyPointsRedeemed;
	}

	/**
	 * @param loyaltyPointsRedeemed reward points redeemed
	 */
	public void setLoyaltyPointsRedeemed(int loyaltyPointsRedeemed) {
		this.loyaltyPointsRedeemed = loyaltyPointsRedeemed;
	}
}
